package org.jiucai.cas.domain;

import java.io.Serializable;
import java.util.Date;

import org.jiucai.appframework.base.domain.BaseDomain;
import org.jiucai.appframework.common.util.EscapeUtil;

/**
 * 用户对象
 * @author zhaidw
 *
 */
public class UserInfo extends BaseDomain implements Serializable {
	
	/**
	 * 用户类型：管理员
	 */
	public static final String  USER_TYPE_ADMIN		= "admin";
	
	/**
	 * 用户类型：主账户（广告主）
	 */
	public static final String  USER_TYPE_USER			= "user";
	
	
	/**
	 * 用户类型：子账户
	 */
	public static final String  USER_TYPE_SUB_USER		= "sub_user";
	
	
	
	

	private static final long serialVersionUID = -5320257834723733881L;
	
	
	private Long userId;
	private Long parentUserId;
	private String userType;
	private String loginName;
	private String displayName;
	private String password;
	private Integer locked;
	private String companyName;
	private String companyAddress;
	private String companyPostCode;
	private String companyPhone;
	private String companyFax;
	private String linkmanName;
	private String linkmanMobile;
	private String linkmanEmail;
	private Integer deleted;

	private Integer allowFrontApp;
	private Integer allowAdminApp;
	
	private Date lastLoginTime;
	private String lastLoginIp;
	private Integer loginTimes;

	private String createUser;
	private String updateUser;

	private Date createTime;
	private Date updateTime;

	public UserInfo() {
		super();
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getParentUserId() {
		return parentUserId;
	}

	public void setParentUserId(Long parentUserId) {
		this.parentUserId = parentUserId;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getDisplayName() {
		return EscapeUtil.escape(displayName);
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getLocked() {
		return locked;
	}

	public void setLocked(Integer locked) {
		this.locked = locked;
	}

	public String getCompanyName() {
		return EscapeUtil.escape(companyName);
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCompanyAddress() {
		return EscapeUtil.escape(companyAddress);
	}

	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}

	public String getCompanyPostCode() {
		return EscapeUtil.escape(companyPostCode);
	}

	public void setCompanyPostCode(String companyPostCode) {
		this.companyPostCode = companyPostCode;
	}

	public String getCompanyPhone() {
		return EscapeUtil.escape(companyPhone);
	}

	public void setCompanyPhone(String companyPhone) {
		this.companyPhone = companyPhone;
	}

	public String getCompanyFax() {
		return EscapeUtil.escape(companyFax);
	}

	public void setCompanyFax(String companyFax) {
		this.companyFax = companyFax;
	}

	public String getLinkmanName() {
		return EscapeUtil.escape(linkmanName);
	}

	public void setLinkmanName(String linkmanName) {
		this.linkmanName = linkmanName;
	}

	public String getLinkmanMobile() {
		return EscapeUtil.escape(linkmanMobile);
	}

	public void setLinkmanMobile(String linkmanMobile) {
		this.linkmanMobile = linkmanMobile;
	}

	public String getLinkmanEmail() {
		return EscapeUtil.escape(linkmanEmail);
	}

	public void setLinkmanEmail(String linkmanEmail) {
		this.linkmanEmail = linkmanEmail;
	}

	public Integer getDeleted() {
		return deleted;
	}

	public void setDeleted(Integer deleted) {
		this.deleted = deleted;
	}

	public Integer getAllowFrontApp() {
		return allowFrontApp;
	}

	public void setAllowFrontApp(Integer allowFrontApp) {
		this.allowFrontApp = allowFrontApp;
	}

	public Integer getAllowAdminApp() {
		return allowAdminApp;
	}

	public void setAllowAdminApp(Integer allowAdminApp) {
		this.allowAdminApp = allowAdminApp;
	}

	public String getCreateUser() {
		return EscapeUtil.escape(createUser);
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLastLoginIp() {
		return EscapeUtil.escape(lastLoginIp);
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	public Integer getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(Integer loginTimes) {
		this.loginTimes = loginTimes;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("UserInfo [userId=");
		builder.append(userId);
		builder.append(", parentUserId=");
		builder.append(parentUserId);
		builder.append(", userType=");
		builder.append(userType);
		builder.append(", loginName=");
		builder.append(loginName);
		builder.append(", displayName=");
		builder.append(displayName);
		builder.append(", password=");
		builder.append(password);
		builder.append(", locked=");
		builder.append(locked);
		builder.append(", companyName=");
		builder.append(companyName);
		builder.append(", companyAddress=");
		builder.append(companyAddress);
		builder.append(", companyPostCode=");
		builder.append(companyPostCode);
		builder.append(", companyPhone=");
		builder.append(companyPhone);
		builder.append(", companyFax=");
		builder.append(companyFax);
		builder.append(", linkmanName=");
		builder.append(linkmanName);
		builder.append(", linkmanMobile=");
		builder.append(linkmanMobile);
		builder.append(", linkmanEmail=");
		builder.append(linkmanEmail);
		builder.append(", deleted=");
		builder.append(deleted);
		builder.append(", allowFrontApp=");
		builder.append(allowFrontApp);
		builder.append(", allowAdminApp=");
		builder.append(allowAdminApp);
		builder.append(", lastLoginTime=");
		builder.append(lastLoginTime);
		builder.append(", lastLoginIp=");
		builder.append(lastLoginIp);
		builder.append(", loginTimes=");
		builder.append(loginTimes);
		builder.append(", createUser=");
		builder.append(createUser);
		builder.append(", updateUser=");
		builder.append(updateUser);
		builder.append(", createTime=");
		builder.append(createTime);
		builder.append(", updateTime=");
		builder.append(updateTime);
		builder.append("]");
		return builder.toString();
	}

	

}
